import rtconfig
Import('RTT_ROOT')
from building import *

# get current directory
cwd = GetCurrentDir()

# The set of source files associated with this SConscript file.
src = Split("""
Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
""")

# Add for startup script 
if rtconfig.CROSS_TOOL == 'gcc':
     src = src + ['Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f427_437xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
     src = src + ['Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f427_437xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
     src = src + ['Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f427_437xx.s']

path = [cwd + '/Device/ST/STM32F4xx/Include',cwd + '/Include']

CPPDEFINES = ['USE_STDPERIPH_DRIVER', 'STM32F427_437xx']

group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)

Return('group')
